# Maintainer: TBK <alpine@jjtc.eu>
pkgname=php7-pecl-mcrypt
_pkgreal=mcrypt
pkgver=1.0.3
pkgrel=2
pkgdesc="Provides bindings for the unmaintained libmcrypt."
url="https://pecl.php.net/package/mcrypt"
arch="all"
license="PHP-3.01"
depends="php7-common"
makedepends="pcre-dev php7-dev libmcrypt-dev"
source="https://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
builddir="$srcdir/$_pkgreal-$pkgver"
provides="php7-mcrypt=$pkgver-r$pkgrel" # for backward compatibility
replaces="php7-mcrypt" # for backward compatibility

build() {
	phpize7
	./configure --prefix=/usr --with-php-config=php-config7
	make
}

check() {
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test
}

package() {
	make INSTALL_ROOT="$pkgdir"/ install
	install -d "$pkgdir"/etc/php7/conf.d
	echo "extension=$_pkgreal.so" > "$pkgdir"/etc/php7/conf.d/$_pkgreal.ini
}

sha512sums="ef215b576b471d6e1ecac4bb097f518fa57fd551b678b7fdddd9d5058f6667b0ee757e887f00b61672b89cd86f1962cbfe0e355681fa47daba9873c3bf4db679  mcrypt-1.0.3.tgz"
